<template>
  <div class="not-found-page">
    <div class="container">
      <div class="error-content">
        <div class="error-code">404</div>
        <h1 class="error-title">页面未找到</h1>
        <p class="error-message">抱歉，您访问的页面不存在或已被移除。</p>
        <div class="action-buttons">
          <router-link to="/" class="primary-btn">
            <el-icon><back /></el-icon> 返回首页
          </router-link>
          <button class="secondary-btn" @click="goBack">
            <el-icon><arrow-left /></el-icon> 返回上一页
          </button>
        </div>
        <div class="illustration">
          <img src="@/assets/images/404.svg" alt="页面未找到" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { Back, ArrowLeft } from '@element-plus/icons-vue'

const router = useRouter()

// 返回上一页
const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.not-found-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #f5f7fa;
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
  }
  
  .error-content {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
  }
  
  .error-code {
    font-size: 120px;
    font-weight: 700;
    color: #409EFF;
    line-height: 1;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #e0eaff;
  }
  
  .error-title {
    font-size: 32px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 16px;
  }
  
  .error-message {
    font-size: 16px;
    color: #606266;
    margin-bottom: 32px;
  }
  
  .action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    
    .primary-btn,
    .secondary-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 24px;
      border-radius: 4px;
      font-size: 16px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      
      i {
        margin-right: 8px;
      }
    }
    
    .primary-btn {
      background-color: #409EFF;
      color: #fff;
      border: none;
      
      &:hover {
        background-color: #66b1ff;
      }
    }
    
    .secondary-btn {
      background-color: #f0f2f5;
      color: #606266;
      border: none;
      
      &:hover {
        background-color: #e6e8eb;
      }
    }
  }
  
  .illustration {
    margin-top: 32px;
    
    img {
      max-width: 100%;
      height: auto;
      max-height: 300px;
    }
  }
  
  // 响应式适配
  @media (max-width: 768px) {
    .error-code {
      font-size: 80px;
    }
    
    .error-title {
      font-size: 24px;
    }
    
    .action-buttons {
      flex-direction: column;
      gap: 12px;
      
      .primary-btn,
      .secondary-btn {
        width: 100%;
      }
    }
  }
}
</style> 